package main

import "fmt"

func main() {
	// map 和 slice组合
	// 元素类型为map的切片  	[]map[int]string
	var s1 = make([]map[int]string, 10, 10)
	fmt.Println(s1)

	// var s1 = make([]map[int]string, 0, 10)
	// s1[0][100] = "A"

	// slice 和 map 都要初始化
	s1[0] = make(map[int]string, 1)
	s1[0][10] = "沙河"
	// index out of range 索引越界
	fmt.Printf("len(s1[0]): %d ; cap(s1): %d;\n", len(s1[0]), cap(s1))

	// fmt.Printf("%T", s1[0])
	fmt.Println(s1)

	// 值为切片类型的map
	var m1 = make(map[string][]int, 10)
	m1["北京"] = []int{10, 20, 30}
	fmt.Println(m1)
}
